<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <div>{{num}}</div>
        <button v-on:click='add(8)'>点我加8</button>
        <button v-on:click='add(addNum)'>点我加+=1</button>
    </div>
    <script>
        const vm =new Vue({
            el:'#app',
            data:{
               num:4,
               addNum:1
            },
            methods:{
                add(num){
                    this.num +=num
                    this.addNum +=1
                }
            }
        }) 
    </script>
</body>
</html>